{% extends "base.html" %}

{% set crumbs = [(url('kbadge.badges_list'), _('Badges')), (url('kbadge.awards_list'), _('Recently Awarded')), (None, pgettext('DB: badger.Badge.title', badge.title))] %}
{% set styles=('badges',) %}

{% block content %}
<div class="grid_6">
  <h2>
    {% trans badge_name=pgettext('DB: badger.Badge.title', badge.title) %}
      Awarded badge: {{ badge_name }}
    {% endtrans %}
  </h2>

  <dl class="badge-details" data-slug="{{ badge.slug }}">
    {% if badge.image %}
      <dt>{{ _('Image:') }}</dt>
      <dd class="image"><a href="{{ badge.get_absolute_url() }}" class="image"><img src="{{ badge.image.url }}" width="256" height="256" /></a></dd>
    {% endif %}

    {% if badge.description %}
      <dt>{{ _('Description:') }}</dt>
      <dd class="description">{{ pgettext('DB: badger.Badge.description', badge.description) }}</dd>
    {% endif %}

    {% if badge.creator %}
      <dt>{{ _('Creator:') }}</dt>
      <dd><a href="{{ profile_url(badge.creator) }}">{{ badge.creator }}</a></dd>
    {% endif %}

    <dt>{{ _('Created:') }}</dt>
    <dd>{{ datetimeformat(badge.created) }}</dd>

    <dt>{{ _('Modified:') }}</dt>
    <dd>{{ datetimeformat(badge.modified) }}</dd>
  </dl>
</div>

<div class="grid_6">
  <h2>{{ _('Award details') }}</h2>
  <dl class="badge-details">
    <dt>{{ _('Awarded to:') }}</dt>
    <dd class="awarded_to">
      <a href="{{ profile_url(award.user) }}">
        <img src="{{ profile_avatar(award.user) }}" alt="" title="{{ display_name(award.user) }}">
        <br>{{ award.user }}
      </a>
    </dd>

    {% if award.description %}
      <dt>{{ _('Explanation:') }}</dt>
      <dd class="description">{{ award.description }}</dd>
    {% endif %}

    {% if award.creator %}
      <dt>{{ _('Awarded by:') }}</dt>
      <dd>
        <a href="{{ profile_url(award.creator) }}">
          <img src="{{ profile_avatar(award.creator) }}" alt="" title="{{ award.creator }}">
          {{ award.creator }}
        </a>
      </dd>
    {% endif %}

    <dt>{{ _('Issued on:') }}</dt>
    <dd>{{ datetimeformat(award.created) }}</dd>
  </dl>
</div>
{% endblock %}
